<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			#body {
				width: 100%;
				height: 800px;
				display: flex;
				justify-content: center;
			}

			#zzc {
				width: 600px;
				height: 500px;
				overflow: hidden;
			}

			#imgList {
				/* display: flex;
			width: 1600px;
			height: 100px;
			justify-content: center;  居中*/
				width: 1600px;
				height: 100px;
				display: flex;
				position: relative;
				top: 200px;
				/* align-items: center; */
				/* justify-content: center; */
				/* margin-top: 200px; */
			}

			#imgList img {
				width: 100px;
				height: 100px;
			}
		</style>
	</head>
	<body>
		<div id="body">
			<div id="zzc">
				<div id="imgList" onmouseenter="mouseOn();" onmouseleave="mouseLeave();">
					<img src="img/lunbo/1.jpeg">
					<img src="img/lunbo/2.jpeg">
					<img src="img/lunbo/3.jpeg">
					<img src="img/lunbo/4.jpeg">
					<img src="img/lunbo/5.jpeg">
					<img src="img/lunbo/6.jpeg">
					<img src="img/lunbo/7.jpeg">
					<img src="img/lunbo/8.jpeg">
					<img src="img/lunbo/9.jpeg">
					<img src="img/lunbo/10.jpeg">
					<img src="img/lunbo/1.jpeg">
					<img src="img/lunbo/2.jpeg">
					<img src="img/lunbo/3.jpeg">
					<img src="img/lunbo/4.jpeg">
					<img src="img/lunbo/5.jpeg">
					<img src="img/lunbo/6.jpeg">
				</div>
			</div>
		</div>
	</body>
	<script type="text/javascript">
		var x = 0;
		var imgList = document.getElementById('imgList');
		var interval = setInterval(move, 16.6);
		var flag=true;
		function move() {
			x--;
			imgList.style.marginLeft = x + 'px';
			if (x % 100 == 0) {
				clearInterval(interval);
				setTimeout(function() {
					interval = setInterval(move, 16.6);
				}, 1000);
			}
			if (x == -1000) {
				x = 0;
			}
		}

		function mouseOn() {
			clearInterval(interval);
			if(x%100==0){
				flag=false;
			};
		};

		function mouseLeave() {
			console.log('add');
			if(flag){
				interval = setInterval(move, 16.6);
			}
			flag=true;
		}
	</script>
</html>
